import config from "@/config"
import http from "@/utils/request"

export default {
	menu: {
		myMenus: {
			url: `${config.API_URL}/v1/system/menu/my/1.5.0`,
			name: "获取我的菜单",
			get: async function () {
				return await http.get(this.url);
			}
		},
		list: {
			url: `${config.API_URL}/v1/system/menu/list`,
			name: "获取菜单",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		save: {
			url: `${config.API_URL}/v1/system/menu/save`,
			name: "保存菜单（单个）",
			post: async function (data) {
				return await http.post(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		sort: {
			url: `${config.API_URL}/v1/system/menu/sort`,
			name: "菜单拖拽排序（单个）",
			post: async function (data) {
				return await http.post(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		del: {
			url: `${config.API_URL}/v1/system/menu/delete`,
			name: "菜单删除",
			post: async function (data) {
				return await http.post(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
	},
	role: {
		init: {
			url: `${config.API_URL}/v1/system/role/init`,
			name: "角色列表配置",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		list: {
			url: `${config.API_URL}/v1/system/role/list`,
			name: "获取角色列表",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		save: {
			url: `${config.API_URL}/v1/system/role/save`,
			name: "保存角色",
			post: async function (data) {
				return await http.post(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		del: {
			url: `${config.API_URL}/v1/system/role/delete`,
			name: "角色删除",
			post: async function (data) {
				return await http.post(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		permission: {
			url: `${config.API_URL}/v1/system/menu/permission`,
			name: "获取权限菜单",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		psave: {
			url: `${config.API_URL}/v1/system/menu/psave`,
			name: "保存权限菜单",
			post: async function (data) {
				return await http.post(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
	},
	depart: {
		init: {
			url: `${config.API_URL}/v1/system/depart/init`,
			name: "获取部门配置",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		list: {
			url: `${config.API_URL}/v1/system/depart/list`,
			name: "获取部门列表",
			get: async function () {
				return await http.get(this.url);
			}
		},
		save: {
			url: `${config.API_URL}/v1/system/depart/save`,
			name: "保存菜单（单个）",
			post: async function (data) {
				return await http.post(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		sort: {
			url: `${config.API_URL}/v1/system/depart/sort`,
			name: "菜单拖拽排序（单个）",
			post: async function (data) {
				return await http.post(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
		del: {
			url: `${config.API_URL}/v1/system/depart/delete`,
			name: "菜单删除",
			post: async function (data) {
				return await http.post(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
	},
	cfg: {
		list: {
			url: `${config.API_URL}/v1/system/config/list`,
			name: "配置列表",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		save: {
			url: `${config.API_URL}/v1/system/config/save`,
			name: "保存配置（单个）",
			post: async function (data) {
				return await http.post(this.url, data, {
					headers: {
						//'response-status': 401
					}
				});
			}
		},
	},
	dic: {
		tree: {
			url: `${config.API_URL}/v1/system/dic/tree`,
			name: "获取字典树",
			get: async function () {
				return await http.get(this.url);
			}
		},
		list: {
			url: `${config.API_URL}/v1/system/dic/list`,
			name: "字典明细",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		get: {
			url: `${config.API_URL}/v1/system/dic/get`,
			name: "获取字典数据",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		}
	},
	user: {
		list: {
			url: `${config.API_URL}/v1/system/user/list`,
			name: "获取用户列表",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		}
	},
	app: {
		list: {
			url: `${config.API_URL}/v1/system/app/list`,
			name: "应用列表",
			get: async function () {
				return await http.get(this.url);
			}
		}
	},
	log: {
		list: {
			url: `${config.API_URL}/v1/system/log/list`,
			name: "日志列表",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		}
	},
	table: {
		list: {
			url: `${config.API_URL}/v1/system/table/list`,
			name: "表格列管理列表",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		info: {
			url: `${config.API_URL}/v1/system/table/info`,
			name: "表格列管理详情",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		}
	}
}
